package cn.koala.key.firstmaintain.converter;

import cn.koala.key.common.converter.Converter;
import cn.koala.key.firstmaintain.entity.dto.FirstMaintainCardBorrowOrderOutDTO;
import cn.koala.key.firstmaintain.entity.vo.FirstMaintainCardBorrowOrderOutVO;

/**
 * 首保卡借用单视图转数据传输
 *
 * @author liutao
 * @date 2021/2/4
 */
public class FirstMaintainCardBorrowOrderOutVO2DTO implements Converter<FirstMaintainCardBorrowOrderOutVO, FirstMaintainCardBorrowOrderOutDTO> {
    private final String oprNo;
    private final String oprName;

    public FirstMaintainCardBorrowOrderOutVO2DTO(String oprNo, String oprName) {
        this.oprNo = oprNo;
        this.oprName = oprName;
    }

    @Override
    public FirstMaintainCardBorrowOrderOutDTO convert(FirstMaintainCardBorrowOrderOutVO source) {
        if (source == null) {
            return null;
        }
        FirstMaintainCardBorrowOrderOutDTO target = new FirstMaintainCardBorrowOrderOutDTO();
        target.setOrderNo(source.getOrderNo());
        target.setOutLogisticNo(source.getOutLogisticNo());
        target.setSender(source.getSender());
        target.setSenderAddress(source.getSenderAddress());
        target.setSenderCallPhone(source.getSenderCallPhone());
        target.setOprNo(oprNo);
        target.setOprName(oprName);
        return target;
    }
}
